package cn.xchats.rpc.common.dto;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;

/*
 *
 *@author teddy
 *@date 2018/6/28
 */
public class RequestDto<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    @Getter
    private final long id;//每次请求的id不相同
    @Getter
    @Setter
    private T body;//请求体
    private static final AtomicLong autoIncrementId = new AtomicLong(1);//用于自增ID
    @Getter
    @Setter
    private String method;//请求方法

    public RequestDto() {
        id = autoIncrementId.incrementAndGet();
    }


}
